package org.elip.teststatistics.server.selectors;

import org.apache.commons.vfs2.AllFileSelector;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSelectInfo;

public class ScreenshotsFileSelector extends AllFileSelector {
	
	@Override
	public boolean includeFile(FileSelectInfo fileInfo) {

		FileObject file = fileInfo.getFile();
		
		boolean isScreenshot = file.getName().getExtension().equals("png");

		return (isScreenshot);

	}
	
	@Override
	public boolean traverseDescendents(FileSelectInfo fileInfo) {
		if (fileInfo.getDepth() == 0) return true;
		return false;
	}

}
